#include <cstdio>
#include <cstring>
#include <cmath>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 10;
int main()
{
	int t;
	scanf("%d",&t);
	while(t--)
	{
		int n;
		int cnt = 0;
		int ans = 0;
		int a[maxn];
		scanf("%d",&n);
		while(n)
		{
			cnt++;
			int temp = n%10;
			n = n/10;
			if(temp)
			{
				a[ans] = temp;
				for(int i = 0;i<cnt-1;i++)
				{
					a[ans] = a[ans]*10;
				}
				ans++;
			}
		}
		cout<<ans<<endl;
		for(int i = 0;i<ans-1;i++)
		{
			printf("%d ",a[i]);
		}
		cout<<a[ans-1]<<endl;
	}
} 
